<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <style>
         * {
            margin: 0;
            padding: 0;
        }
     

        .center {
            position: relative;
            width: 520px;
            height: 280px;
            background-color: pink;
            margin: 100px auto;
        }

        .pic {
            width: 520px;
            height: 280px;
        }

        /* 并集选择器可以集体声明相同的样式 */
        
        .left {
            left: 0;
            /* border-radius: 15px; */
            border-top-right-radius: 15px;
            border-bottom-right-radius: 15px;
        }

        .right {
            /* 如果一个盒子既有left属性也有right属性，则默认会执行 left属性 同理  top  bottom  会执行 top */
            right: 0;
            /* border-radius: 15px; */
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
        }
        
    </style>
</head>
<body>
    <div id="mask">
        <div class="center">
            <img :src="imgArr[index]" class="pic"> 
            <a href="javascript:;" @click="prev" class="left">
                <img src="images/方向-左.png"  alt="">
            </a>
            <a href="javascript:;" @click="next" class="right">
                <img src="images/方向-右.png"   alt="">
            </a>
        </div>
    </div>

    <script>
        var app = new Vue({
            el:"#mask",
            data:{
                imgArr:[
                    "./images/00.png",
                    "./images/01.jpg",
                    "./images/02.jpg",
                    "./images/03.png",
                ],
                index: 0
            },
            methods:{
                prev:function(){
                    index--;
                },
                next:function(){
                    index++;
                }
            }
        })
    </script>
</body>
</html>